<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
		'id'=>'user-service-form',
		'enableAjaxValidation'=>false,
)); 
$custom_id=yii::app()->request->getParam(custom_id);
$user_id=yii::app()->request->getParam(user_id);
if($user_id==""){
	$custom=Custom::model()->find('custom_id='.$custom_id);
	$user_id=$custom->user_id;
}else{
	$user_id=$user_id;
}
$userservice=UserService::model()->find('user_id='.$user_id);
?>
	<?php 
		$model2=Custom::model()->find('custom_id='.$custom_id);
		$this->renderPartial('_custom_detail',array('model'=>$model2,)); 
	?>
	<p class="note"><?php echo Yii::t('base','Fields with <span class="required">*</span> are required.')?></p>

	<?php echo $form->errorSummary($model); ?>
		<div>
			<?php echo $form->hiddenField($model,'custom_id',array('value'=>$custom_id));?>
			<?php echo $form->hiddenField($model,'user_id',array('value'=>$model2->user_id));?>
			<?php echo $form->hiddenField($model,'equipment_number',array('value'=>$model2->equipment_number));?>
			<?php echo $form->error($model,'equipment_number'); ?>
		</div>
		<div>
			<?php echo $form->hiddenField($model,'access_id',array('value'=>yii::app()->user->id))?>
			<?php echo $form->error($model,'access_id'); ?>
		</div>
		<div>
			<?php echo $form->labelEx($model,'address'); ?>
			<?php echo $form->dropDownList($model,'address',array('上海'=>'上海','悉尼'=>'悉尼','墨尔本'=>'墨尔本','墨尔本唐人街'=>'墨尔本唐人街'))?>
			<?php echo $form->error($model,'address'); ?>
		</div>
		<div class="row">
		<?php echo $form->labelEx($model,'refund_type'); ?>
		<?php echo $form->dropDownList($model,'refund_type',array('0'=>'现金','1'=>'刷卡')); ?>
		<?php echo $form->error($model,'refund_type'); ?>
	</div>
			<?php echo $form->labelEx($model,'time'); ?>
		<?php   
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
    'name'=>'Custom[time]',
	'id'=>'Custom_time',
	'value'=>$model->time!="0000-00-00"?$model->time:date("Y-m-d",strtotime("+7 days")),
    // additional javascript options for the date picker plugin
    'options'=>array(
        'showAnim'=>'fold',
		'dateFormat'=>'yy-mm-dd',
    ),
    'htmlOptions'=>array(
        'style'=>'height:30px;'
    ),
));
?>  
		<?php echo $form->error($model,'time'); ?>
		<div class="row buttons">
	<?php echo CHtml::submitButton($model->isNewRecord ? Yii::t('base','Create') : Yii::t('base','Save')); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->
